<template>
  <el-dialog
    :width="props.submitFormWidth"
    :title="props.submitFormTitle"
    :close-on-click-modal="false"
  >
    <slot name="submitDialogSlot"></slot>
    <template #footer>
      <div class="dialog-footer">
        <div style="float: left">
          <el-button type="primary" @click="previousRecord" v-show="true"
            >上一条
          </el-button>
          <el-button type="primary" @click="nextRecord" v-show="true"
            >下一条
          </el-button>
        </div>
        <el-button @click="changeSubmitFormDialogVisible()">取消 </el-button>
        <el-button type="primary" @click="submit()">确认</el-button>
        <el-button
          type="primary"
          @click="
            submit();
            changeSubmitFormDialogVisible();
          "
          >确认并关闭
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { inject } from "vue";

const props = inject("props");

const changeSubmitFormDialogVisible = inject(
  "changeSubmitFormDialogVisible"
) as () => void;

const submit = inject("submit") as () => void;

const previousRecord = () => {
  // setFormInitValue();
  console.log("previousRecord");
};
const nextRecord = () => {
  console.log("nextRecord");
};
</script>

<style scoped></style>
